package com.tcm.order.service;


import com.base.core.exception.ServiceException;
import com.base.core.pager.PageBean;
import com.tcm.order.domain.dto.OrderDTO;

/**
 * 
 * @Description: 订单服务类
 * @author biuco 2020年3月7日上午11:24:24
 *
 */
public interface OrderService {


	int cancel(Long userId, Long orderId) throws Exception;

	/**
	 * 更新订单支付状态
	 * @param orderId
	 * @return
	 */
	void changOrderPaid(Long orderId) throws Exception;

	/**
	 * 确认收货
	 * @param orderId
	 */
    void confirmOrderStatus(Long orderId);


	/**
	 * 订单列表
	 * @param
	 * @return
	 * @throws Exception
	 */
	PageBean<OrderDTO> listPageOrderByStatus(Byte status, Long start, Long pagesize) throws Exception;


	Long countOrderByUser(Long userId);

	/**
	 * 用户订单列表
	 * @param userId
	 * @param status
	 * @param start
	 * @param pagesize
	 * @return
	 * @throws Exception
	 */
	PageBean<OrderDTO> listPageOrderByUser(Long userId, Byte status, Long start, Long pagesize) throws Exception;

	/**
	 * 管理后台的各状态下订单总数
	 * @param status
	 * @return
	 */
    Long countOrderByStatus(Byte status);

    /**
	 * 用户订单列表
	 * @param userId
	 * @param start
	 * @param pagesize
	 * @return
	 * @throws Exception
	 */
	PageBean<OrderDTO> listPageOrderByUser(Long userId, Long start, Long pagesize) throws Exception;

	/**
	 * 药房订单列表
	 * @param storeId
	 * @param status
	 * @param start
	 * @param pagesize
	 * @return
	 * @throws Exception
	 */
	PageBean<OrderDTO> listPageOrderByStore(Long storeId, Byte status, Long start, Long pagesize) throws Exception;


	Long countOrderByUser(Long userId, Byte status);

	/**
	 * 药房订单列表
	 * @param storeId
	 * @param start
	 * @param pagesize
	 * @return
	 * @throws Exception
	 */
	PageBean<OrderDTO> listPageOrderByStore(Long storeId, Long start, Long pagesize) throws Exception;

	/**
	 * 医生订单列表
	 * @param doctorId
	 * @param start
	 * @param pagesize
	 * @return
	 * @throws Exception
	 */
	PageBean<OrderDTO> listPageOrderByDoctor(Long doctorId, Long start, Long pagesize) throws Exception;

	Long countOrderByDoctor(Long doctorId);

	/**
	 * 获得订单详情
	 * @param orderId 订单id
	 * @return
	 * @throws Exception
	 */
	OrderDTO findDetailByOrderId(Long orderId) throws Exception;

    String findDeliveryInfoByOrderId(Long orderId);

    /**
	 * 逻辑删除
	 * @param orderId 订单id
	 * @return
	 * @throws Exception
	 */
	int delete(Long orderId) throws Exception;

	/**
	 * 永久删除
	 * @param orderId 订单id
	 * @return
	 * @throws Exception
	 */
	int emptyTrash(Long orderId) throws Exception;

	/**
	 * 创建订单
	 * @param orderDto 订单实体
	 * @throws Exception
	 */
	Long create(OrderDTO orderDto) throws Exception;

	int savePayment(Long orderId, String payChannel) throws Exception;

}
